<template>
  <el-dialog
    :model-value="visible"
    :close-on-press-escape="false"
    :close-on-click-modal="false"
    :width="width"
    :top="top"
    :show-close="false"
  >
    <template #header>
      <div class="header">
        <div class="title">{{ title }}</div>
        <img
          @click="hidenDia"
          v-if="showImg"
          src="../assets/images/false.png"
          alt=""
        />
        <slot name="showImg" />
      </div>
    </template>
    <slot name="content" />
    <slot name="footer" />
  </el-dialog>
</template>
<script setup lang="ts">
const props = defineProps({
  visible: {
    type: Boolean,
  },
  width: {
    default: "35%",
  },
  top: {
    default: "15vh",
  },
  showImg: {
    default: true,
  },
  title: {},
});

let emit = defineEmits(["update:visible"]);
import { ref } from "vue";

const hidenDia = () => {
  emit("update:visible", false);
};
</script>
<style lang="scss" scoped>
.my-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.header {
  height: 49px;
  background: #061021;
  border-radius: 10px 10px 0px 0px;
  margin: 3px 3px 0 3px;
  display: flex;
  padding: 0 36px 0 28px;
  justify-content: space-between;
  align-items: center;
  .title {
    font-size: 24px;
    font-weight: 500;
    color: #ffffff;
  }
  img {
    width: 19px;
    height: 19px;
    cursor: pointer;
  }
}
</style>
